﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RaytracerLib.MathLib;
using YAXLib;

namespace RaytracerLib.Attenuations
{
    public abstract class Attenuation
    {
        public static Attenuation Create(AttenuationMethod a_method)
        {
            if (a_method == AttenuationMethod.None)
                return null;
            else if (a_method == AttenuationMethod.Polynomial)
                return new PolynomialAttenuation();
            else if (a_method == AttenuationMethod.Exponental)
                return new ExponentalAttenuation();
            else
                throw new InvalidOperationException();
        }

        public abstract void CalculateAttenuation(double a_light_speed);
        public abstract ColorFloat Attenuate(ColorFloat a_light, double a_dist);
    }
}
